<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the values most recently detected by Ev</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.evstat.html">EvStat</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evstat.construct.html">EvStat::__construct</a></div>
 <div class="up"><a href="class.evstat.html">EvStat</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="evstat.attr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EvStat::attr</h1>
  <p class="verinfo">(PECL ev &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">EvStat::attr</span> &mdash; <span class="dc-title">Returns the values most recently detected by Ev</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-evstat.attr-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">array</span> 
   <span class="methodname"><strong>EvStat::attr</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Returns array of the values most recently detected by Ev
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-evstat.attr-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-evstat.attr-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns array with the values most recently detect by Ev(without actual
   <em>stat</em>
   &#039;ing):
   <table class="doctable table">
    <caption><strong>
    List for item keys of the array returned by <span class="methodname"><strong>EvStat::attr()</strong></span>
    </strong></caption>
    
     <thead>
      <tr>
       <th>Key</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>
        <strong><code>&#039;dev&#039;</code></strong>
       </td>
       <td>ID of device containing file</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;ino&#039;</code></strong>
       </td>
       <td>inode number</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;mode&#039;</code></strong>
       </td>
       <td>protection</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;nlink&#039;</code></strong>
       </td>
       <td>number of hard links</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;uid&#039;</code></strong>
       </td>
       <td>user ID of owner</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;size&#039;</code></strong>
       </td>
       <td>total size, in bytes</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;gid&#039;</code></strong>
       </td>
       <td>group ID of owner</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;rdev&#039;</code></strong>
       </td>
       <td>device ID (if special file)</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;blksize&#039;</code></strong>
       </td>
       <td>blocksize for file system I/O</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;blocks&#039;</code></strong>
       </td>
       <td>number of 512B blocks allocated</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;atime&#039;</code></strong>
       </td>
       <td>time of last access</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;ctime&#039;</code></strong>
       </td>
       <td>time of last status change</td>
      </tr>

      <tr>
       <td>
        <strong><code>&#039;mtime&#039;</code></strong>
       </td>
       <td>time of last modification</td>
      </tr>

     </tbody>
    
   </table>

  </p>
  <p class="para">
   See
   <em>stat(2)</em>
   man page for details.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-evstat.attr-examples">
  <h3 class="title">范例</h3>
 <div class="example" id="example-3538">
   <p><strong>Example #1 Monitor changes of /var/log/messages</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Use&nbsp;10&nbsp;second&nbsp;update&nbsp;interval.<br /></span><span style="color: #0000BB">$w&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">EvStat</span><span style="color: #007700">(</span><span style="color: #DD0000">"/var/log/messages"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">,&nbsp;function&nbsp;(</span><span style="color: #0000BB">$w</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"/var/log/messages&nbsp;changed\n"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$attr&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$w</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">attr</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'nlink'</span><span style="color: #007700">])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Current&nbsp;size:&nbsp;%ld\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'size'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Current&nbsp;atime:&nbsp;%ld\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'atime'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"Current&nbsp;mtime:&nbsp;%ld\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$attr</span><span style="color: #007700">[</span><span style="color: #DD0000">'mtime'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">fprintf</span><span style="color: #007700">(</span><span style="color: #0000BB">STDERR</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"`messages`&nbsp;file&nbsp;is&nbsp;not&nbsp;there!"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$w</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">stop</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />});<br /><br /></span><span style="color: #0000BB">Ev</span><span style="color: #007700">::</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-evstat.attr-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="evstat.prev.html" class="methodname" rel="rdfs-seeAlso">EvStat::prev()</a> - Returns the previous set of values returned by EvStat::attr</span>
   </li>
   <li class="member">
    <span class="methodname"><a href="evstat.stat.html" class="methodname" rel="rdfs-seeAlso">EvStat::stat()</a> - Initiates the stat call</span>
   </li>
  </ul>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.evstat.html">EvStat</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evstat.construct.html">EvStat::__construct</a></div>
 <div class="up"><a href="class.evstat.html">EvStat</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
